package demo11_3;

class OuterClass {
    public int data1 = 1;
    private int data2 = 2;
    public static int data3 = 3;
    static class InnerClass {
        public int data4 = 4;
        private int data5 = 5;
        public static int data6 = 6;
        public void test() {
            OuterClass outerClass = new OuterClass();
            System.out.println(outerClass.data1);
            System.out.println(data3);
            System.out.println("内部类的test方法");
        }
    }
    public void test() {
        System.out.println("外部类的test方法");
    }
}
public class Test11_3 {

    public void method() {
        int data1 = 1;
        class Inner {
            public int data2 = 2;
        }
        Inner inner = new Inner();
        System.out.println(inner.data2);
    }
    public static void main(String[] args) {
//        OuterClass.InnerClass innerClass = new OuterClass.InnerClass();
//        innerClass.test();
        Test11_3 test11_3 = new Test11_3();
        test11_3.method();
    }
}
